import { defineStore } from 'pinia';
import { ref } from 'vue';

// 库存计数状态管理，缺货商品种类数量和紧张商品种类数量
export const useStockCountStore = defineStore('stockCount', () => {
  const outOfStockCount = ref(0);
  const lowStockCount = ref(0);

  const updateStockCount = (outOfStock: number, lowStock: number) => {
    outOfStockCount.value = outOfStock;
    lowStockCount.value = lowStock;
  };

  return {
    outOfStockCount,
    lowStockCount,
    updateStockCount,
  };
});
 